<?php
/*
	模版消息设置
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'wechat';
$tabs=array(
	array('op'=>'wechat','title'=>'微信模版消息模版'),
	array('op'=>'sms','title'=>'短信消息模版'),
	array('op'=>'voice','title'=>'语音短信消息模版'),
);
set_html('tabs',$tabs);
if($_RQ['op']=='wechat'){
	if($_RQ['postdata']){
		$post=get_postdata();
		
		$this->plugin_setting('template',$post);
		exi('设置成功！');
	}
	$setting=$this->plugin_setting('template');
	$return['item']=$setting;
	$return['htmls']=array(
		'type'=>'edit',
		'edit'=>array(
			array('type'=>'string','name'=>'wechat_move','title'=>'挪车通知模版','help'=>'设置向车主发送挪车通知时使用的消息模版，请填写消息ID'),
		),
	);
	exi($return);
}
if($_RQ['op']=='sms'){
	if($_RQ['postdata']){
		$post=get_postdata();
		
		$this->plugin_setting('template',$post);
		exi('设置成功！');
	}
	$setting=$this->plugin_setting('template');
	$return['item']=$setting;
	$return['htmls']=array(
		'type'=>'edit',
		'edit'=>array(
			array('type'=>'string','name'=>'sms_move','title'=>'挪车通知模版','help'=>'设置向车主发送挪车通知时使用的消息模版，请填写消息ID。模版变量：{plate}——车牌号'),
		),
	);
	exi($return);
}
if($_RQ['op']=='voice'){
	if($_RQ['postdata']){
		$post=get_postdata();
		
		$this->plugin_setting('template',$post);
		exi('设置成功！');
	}
	$setting=$this->plugin_setting('template');
	$return['item']=$setting;
	$return['htmls']=array(
		'type'=>'edit',
		'edit'=>array(
			array('type'=>'string','name'=>'voice_move','title'=>'挪车通知模版','help'=>'设置向车主发送挪车通知时使用的消息模版，请填写消息ID。模版变量：{plate}——车牌号'),
		),
	);
	exi($return);
}